<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class PcontentPostRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required',
            'pic' => 'required|image',
            'intro' => 'required',
            'pauthor' => 'required',
            'editorValue' => 'required',
        ];
    }

     /**
     * 获取已定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [
            'title.required' => '项目内容名不能为空',
            'pic.image'  => '文件格式不正确',
            'pic.required'  => '项目主图不能为空',
            'intro.required' => '项目内容概述不能为空',
            'pauthor.required' => '项目发表人不能为空',
            'editorValue.required' => '项目内容不能为空',

        ];
    }
}
